#ifndef __LOGIC_SOCKET_H__
#define __LOGIC_SOCKET_H__

#include <sys/socket.h>
#include "mysocket.h"

//处理逻辑和通讯的子类
class LogicSocket : public MySocket {
public:
	LogicSocket();
	virtual ~LogicSocket();
	virtual bool Initialize();

	void SendNoBodyPkgToClient(LPSTRUC_MSG_HEADER msg_header, unsigned short msg_code);
	//各种业务逻辑相关函数
	bool _HandleRegister(lpconnection_t connect, LPSTRUC_MSG_HEADER msg_header, char *pkg_body, unsigned short body_length);
	bool _HandleLogIn(lpconnection_t connect, LPSTRUC_MSG_HEADER msg_header, char *pkg_body, unsigned short body_length);
	bool _HandlePing(lpconnection_t connect, LPSTRUC_MSG_HEADER msg_header, char *pkg_body, unsigned short body_length);

	//心跳包检查
	//...
	
	//线程接收处理函数
	virtual void ThreadRecvProcFunc(char *msg_buf);
	virtual void ProcPingTimeOutChecking(LPSTRUC_MSG_HEADER tmp_msg, time_t current_time);
}; 


#endif
